<?php

require dirname(__FILE__) . '/sht/startup.php';

$data = $_REQUEST;

$requiredField = array('MerNo', 'BillNo', 'Currency', 'Amount', 'ReturnURL', 'MD5info');

foreach($requiredField as $field){
    if(!varGet($data, $field, null)){
        die("request error");
    }
}

$CurrencyArray  = array('EUR'=>'2', 'USD'=>'1', 'JPY'=>'6', 'GBP'=>'4', 'AUD'=>'7', 'CAD'=>'11', 'NOK'=>'8','RMB'=>'3','DKK'=>'12','HKD'=>'5','SEK'=>'13');
foreach($CurrencyArray as $key => $value){
    if($value == $data['Currency']){
        $data['CurrencyName'] = $key;
        break;
    }
}

 $data['shippingCountry'] = varGet($data, 'DeliveryCountry');
 $data['shippingCity'] = varGet($data, 'DeliveryCity');
 $data['shippingFirstName'] = varGet($data, 'DeliveryFirstName');
 $data['shippingLastName'] = varGet($data, 'DeliveryLastName');
 $data['shippingAddress'] = varGet($data, 'DeliveryAddress');
 $data['shippingSstate'] = varGet($data, 'DeliveryState');
 $data['shippingZipcode'] = varGet($data, 'DeliveryZipCode');
 $data['shippingEmail'] = varGet($data, 'DeliveryEmail');
 $data['shippingPhone'] = varGet($data, 'DeliveryPhone');

createToken($data);
$data = array_merge($data, $langData);

if(file_exists(DIR_PAY_VIEW_FILE)){
    require DIR_PAY_VIEW_FILE;
}else{
    die('Not Found!');
}

